
var login_ele = document.querySelector(".btn-block");
console.log(login_ele);

var inputusr_ele = document.getElementById("inputEmail");
var inputpwd_ele = document.getElementById("inputPassword");
login_ele.onclick = function () {
    // 获取用户输入的内容;
    var inputusr_value = inputusr_ele.value;
    var inputpwd_value = inputpwd_ele.value;
    // 发起请求;
    // 拼接路径把用户的信息发送出去;
    var url = "http://localhost/project/server/login.php";
    // 发起请求;
    xhrGet(url, {
            username: inputusr_value,
            password: inputpwd_value
        })
        .then(function (res) {
            var res = JSON.parse(res);
            if (res.state === "success") {
                location.assign("./index.html");
            }
        });
}